<?php
/**
 * @fileName:Director.php
 * @project:basic_knowledge
 * @author : 吐火青蛙
 * @user : 吐火青蛙
 * @date : 2020/4/11
 *
 */

namespace miaosang\basicknowledge\design\builder;

use miaosang\basicknowledge\design\builder\BuilderInterface;
use miaosang\basicknowledge\design\builder\parts\Vehicle;

class Director
{
    public function build(BuilderInterface $builder): Vehicle
    {
        $builder->createVehicle();
        $builder->addDoors();
        $builder->addEngine();
        $builder->addWheel();
        return $builder->getVehicle();
    }

}
